<%@ page import="com.portico.dept.solarch.ProjectDashboard" %>


<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
    <meta name="layout" content="main"/>
    <g:set var="entityName" value="${message(code: 'projectDashboard.label', default: 'ProjectDashboard')}"/>
    <title><g:message code="default.list.label" args="[entityName]"/></title>
</head>

<body>
%{--<div class="nav">--}%
%{--<span class="menuButton"><a class="home" href="${createLink(uri: '/')}"><g:message code="default.home.label"/></a></span>--}%
%{--<span class="menuButton"><g:link class="create" action="create"><g:message code="default.new.label" args="[entityName]" /></g:link></span>--}%
%{--</div>--}%
<div class="body">
    %{--<h1><g:message code="default.list.label" args="[entityName]" /></h1>--}%
    <h1/>
    <g:if test="${flash.message}">
        <div class="message">${flash.message}</div>
    </g:if>

    <gui:expandablePanel bounce="false" title="RED - YELLOW - GREEN Dashboard (Future/Onward Looking Projection)"
                         expanded="true">

        <div class="list">
            <table>
                <thead>
                <tr>

                    <g:sortableColumn property="id"
                                      title="${message(code: 'projectDashboard.id.label', default: 'Id')}"/>

                    <g:sortableColumn property="trend"
                                      title="${message(code: 'projectDashboard.trend.label', default: 'Trend')}"/>

                    <g:sortableColumn property="budget"
                                      title="${message(code: 'projectDashboard.budget.label', default: 'Budget')}"/>

                    <g:sortableColumn property="resources"
                                      title="${message(code: 'projectDashboard.resources.label', default: 'Resources')}"/>

                    <g:sortableColumn property="timeline"
                                      title="${message(code: 'projectDashboard.timeline.label', default: 'Timeline')}"/>
                    <g:sortableColumn property="quality"
                                      title="${message(code: 'projectDashboard.quality.label', default: 'Quality')}"/>
                    <g:sortableColumn property="scope"
                                      title="${message(code: 'projectDashboard.scope.label', default: 'Scope')}"/>
                    <g:sortableColumn property="voc"
                                      title="${message(code: 'projectDashboard.voc.label', default: 'VOC')}"/>

                </tr>
                </thead>
                <tbody>
                <g:each in="${projectDashboardInstanceList}" status="i" var="projectDashboardInstance">
                    <g:if test="${projectDashboardInstance.showProjectDashboard}">
                        <tr class="${(i % 2) == 0 ? 'odd' : 'even'}">

                            <td><g:link action="show"
                                        id="${projectDashboardInstance.id}">${fieldValue(bean: projectDashboardInstance, field: "project.name")}</g:link></td>

                            <td>${fieldValue(bean: projectDashboardInstance, field: "trend")}</td>
                            <td class="${fieldValue(bean: projectDashboardInstance, field: "budget")}"></td>
                            <td class="${fieldValue(bean: projectDashboardInstance, field: "resources")}"/>
                            <td class="${fieldValue(bean: projectDashboardInstance, field: "timeline")}"/>
                            <td class="${fieldValue(bean: projectDashboardInstance, field: "quality")}"/>
                            <td class="${fieldValue(bean: projectDashboardInstance, field: "scope")}"/>
                            <td class="${fieldValue(bean: projectDashboardInstance, field: "voc")}"/>
                        </tr>
                    </g:if>
                </g:each>
                </tbody>
            </table>
        </div>
    </gui:expandablePanel>

    <h1/>



    <gui:expandablePanel bounce="false" title="Current Project Status" expanded="true">
        <div class="list">
            <table>
                <thead>
                <tr>
                    <th title="Project Name">Name</th>
                    <th>Trend</th>
                    <th title="Current Status">Status</th>
                    <th>Scope</th>
                    <th title="Project Plan">Plan</th>
                    <th>Governance</th>
                    <th title="Project Resources">Resources</th>
                    <th title="Project Timeline">Timeline</th>
                    <th title="Quality Of Requirements">QoR</th>
                    <th title="Quality Of Build">QoB</th>
                    <th title="Quality Of Code">QoC</th>
                    <th title="Quality Of Design">QoD</th>
                    %{--<th>Status Date</th>--}%
                    <th></th>
                    <th></th>

                </tr>
                </thead>
                <tbody>
                <g:each in="${projectStatusInstanceList}" status="i" var="projectStatusInstance">
                    <tr class="${(i % 2) == 0 ? 'odd' : 'even'}">
                        <td>${fieldValue(bean: projectStatusInstance, field: "project.name")}</td>
                        <td>${fieldValue(bean: projectStatusInstance, field: "trend")}</td>
                        <%=com.portico.util.HTMLUtil.qualityStatusCell(projectStatusInstance.status)%>
                        <%=com.portico.util.HTMLUtil.qualityStatusCell(projectStatusInstance.scope)%>
                        <%=com.portico.util.HTMLUtil.qualityStatusCell(projectStatusInstance.projectPlan)%>
                        <%=com.portico.util.HTMLUtil.qualityStatusCell(projectStatusInstance.governance)%>
                        <%=com.portico.util.HTMLUtil.qualityStatusCell(projectStatusInstance.resources)%>
                        <%=com.portico.util.HTMLUtil.qualityStatusCell(projectStatusInstance.timeline)%>
                        <%=com.portico.util.HTMLUtil.qualityStatusCell(projectStatusInstance.qualityOfRequirements)%>
                        <%=com.portico.util.HTMLUtil.qualityStatusCell(projectStatusInstance.qualityOfBuild)%>
                        <%=com.portico.util.HTMLUtil.qualityStatusCell(projectStatusInstance.qualityOfCode)%>
                        <%=com.portico.util.HTMLUtil.qualityStatusCell(projectStatusInstance.qualityOfDesign)%>
                        %{--<td>${fieldValue(bean: projectStatusInstance, field: "statusDate")}</td>--}%
                        <td><g:link controller="projectStatus" action="show"
                                    params="[id:projectStatusInstance.id]">Details</g:link></td>
                        <td>
                            <gui:toolTip controller="projectStatus" action="ajaxShowComments"
                                         params="[id:projectStatusInstance.id]">
                                <div>Comments</div>
                            </gui:toolTip>
                        </td>
                    </tr>
                </g:each>
                </tbody>
            </table>
        </div>
    </gui:expandablePanel>

</div>
</body>
</html>
